import { createWebHashHistory, createRouter } from "vue-router";
// import Home from "../view/home/index.vue";
import Layout from "../view/Layout.vue";
import Home from "../view/Home/index.vue";

const routes = [
  {
    path: "/",
    component: Layout,
    meta:{title:'家政'},
    // 路由重定向到首页
    redirect: {name:'Home'},
    children: [
      // 首页
      {
        path: "/index",
        name: "Home",
        component: Home,
        meta:{title:'首页'}
      },
      // 客户
      {
        path: "/customer",
        component: () => import("../view/Customer/index.vue"),
        meta:{title:'客户管理'}
      },
      //家政人员
      {
        path:'/worker',
        component:()=>import("../view/Worker/index.vue"),
        meta:{title:'家政人员管理'}
      },
      // ui demo测试 后续得删除
      {
        path:'/ui',
        component:()=>import("../view/ui_text.vue"),
        meta:{title:'UI测试'}
      }
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
